package com.train.service.impl;

import com.train.dto.EmployeeDTO;
import com.train.mapper.EmployeeMapper;
import com.train.pojo.Employee;
import com.train.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeServiceImpl implements EmployeeService {
    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public List<EmployeeDTO> selectAllEmployeeDTO() {
        return employeeMapper.selectAllEmployeeDTO();
    }

    @Override
    public List<Employee> selectAllEmployeeByDepid(int departmentid) {
        return employeeMapper.selectAllEmployeeByDepid(departmentid);
    }

    @Override
    public List<Employee> selectEmployeeByDepid(int departmentid) {
        return employeeMapper.selectEmployeeByDepid(departmentid);
    }

    @Override
    public List<EmployeeDTO> selectAllEmployeeDTOByCourseid(Integer courseid) {
        return employeeMapper.selectAllEmployeeDTOByCourseid(courseid);
    }

    @Override
    public List<EmployeeDTO> findByRequired(EmployeeDTO employeeDTO) {
        return employeeMapper.findByRequired(employeeDTO);
    }

    @Override
    public Employee selectEmployeeByIdcard(String idcard) {
        return employeeMapper.selectEmployeeByIdcard(idcard);
    }

    @Override
    public Employee selectEmployeeById(int id) {
        return employeeMapper.selectEmployeeById(id);
    }

    @Override
    public int addEmployee(Employee employee) {
        return employeeMapper.addEmployee(employee);
    }

    @Override
    public int updateEmployee(Employee employee) {
        return employeeMapper.updateEmployee(employee);
    }

    @Override
    public int deleteEmployee(int id) {
        return employeeMapper.deleteEmployee(id);
    }
}
